import http from "@/api";
import { SelectOptionResult } from "@/api/interface";
import { CreateJobParam, EditJobInfoParam, EditJobStatusParam, GetJobListParam, SysJob } from "@/api/interface/auth/job";

const apiName = "jobManager";

/** 创建岗位 */
export const createJob = (param: CreateJobParam) => {
  return http.post<string>(`${apiName}/CreateJob`, param);
};

/** 获取岗位列表选项（下拉框选项用） */
export const getJobOptions = () => {
  return http.post<SelectOptionResult[]>(`${apiName}/GetJobOptions`);
};

/** 获取岗位列表 */
export const getJobList = (param: GetJobListParam) => {
  return http.post<SysJob[]>(`${apiName}/GetJobList`, param);
};

/** 修改岗位信息 */
export const editJobInfo = (param: EditJobInfoParam) => {
  return http.post<string>(`${apiName}/EditJobInfo`, param);
};

/** 修改岗位状态 */
export const editJobStatus = (param: EditJobStatusParam) => {
  return http.post<string>(`${apiName}/EditJobStatus`, param);
};
